package ooday05;
/*枚举的测试类---简单版*/
public class EnumText {
    public static void main(String[] args) {
        Seasons[] seasons = Seasons.values();//获取所有的枚举
        for (int i=0;i<seasons.length;i++){
            System.out.println(seasons[i]);//SPRING,SUMMER,AUTUMN,WINTER
        }
        System.out.println("-----------------------------");

        Seasons s = Seasons.WINTER;//获取winter对象
        switch (s){
            case SPRING:
                System.out.println("春天到了");
                break;
            case SUMMER:
                System.out.println("夏天到了");
                break;
            case AUTUMN:
                System.out.println("秋天到了");
                break;
            case WINTER:
                System.out.println("冬天到了");
                break;
        }
    }
}
